<html>
<head>
<link rel="stylesheet" type="text/css" href=<?php echo base_url()."zy.css"; ?> />
<title>欢迎</title>
</head>
<body>
<center>
<br />
<br />
<br />
<h1>欢迎 -- 版本1.3.7</h1>
<?php
	function getLocalIP()
	{
	 $preg="/\A((([0-9]?[0-9])|(1[0-9]{2})|(2[0-4][0-9])|(25[0-5]))\.){3}(([0-9]?[0-9])|(1[0-9]{2})|(2[0-4][0-9])|(25[0-5]))\Z/";
	 //获取操作系统为win2000/xp、win7的本机IP真实地址
	 exec("ipconfig",$out,$stats);
	 if(!empty($out))
	 {
	  foreach($out AS $row)
	  {
	   if(strstr($row,"IP") && strstr($row,":") && !strstr($row,"IPv6"))
	   {
	    $tmpIp = explode(":", $row);
	    if(preg_match($preg,trim($tmpIp[1])))
	    {
	     return trim($tmpIp[1]);
	    }
	   }
	  }
	 }
	}

	function GetIP()
	{
		if(!empty($_SERVER["HTTP_CLIENT_IP"]))
		   $cip = $_SERVER["HTTP_CLIENT_IP"];
		else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"]))
		   $cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
		else if(!empty($_SERVER["REMOTE_ADDR"]))
		   $cip = $_SERVER["REMOTE_ADDR"];
		else
		   $cip = "无法获取！";
		return $cip;
	}
	
	$serverip = getLocalIP();
	
	$clientip = GetIP();
	
	if (!strcmp($clientip, "127.0.0.1"))
	{
		$url = base_url()."index.php/zy";
		$url = preg_replace('/\d+\.\d+\.\d+\.\d+/', $serverip, $url);

		echo "通过<a href=".$url.">"."$url"."</a>可以在其他设备上访问本站!";
		echo "<a href=http://qr.liantu.com/api.php?text=$url>点击此处二维码扫描手机访问</a>";
	}
?>
<font color="red">
<h2><a href='zy_addcase'>添加病例</a></h2>
<h2><a href='zy_caselist/index/0'>病例汇总</a></h2>
<h2><a href='zy/search'>查询病例</a></h2>
<h2><a href='zy/export'>导出病例</a></h2>
<h2><a href='zy/importexcel'>导入病例</a></h2>
<h2><a href='zy/manageprescribe'>处方管理</a></h2>
<h2><a href='zy/changebackground'>更换背景</a></h2>
<h2><a href='zy/systemsetting'>系统设置</a></h2>
</font> 
©2013 xiexiecn(hotmail.com)
</center>
</body>
</html>